package top.superflow.exception

class DBServerException(errorCode:String, errorMsg : String, e : Exception) extends Exception(errorMsg, e){
  def this() = this(null,null, null)
  
  def this(errorMsg : String) = this(null,errorMsg, null)
  
  def this(e : Exception ) = this(null,null, e)
  
  def this(errorCode : String, errorMsg : String) =
    this(null, "The error code is " + errorCode + ", the message is " + errorMsg + ".", null) 
}





trait DBServerErrorCode {}
object DBServerErrorCode{
  val CONFIGURATION_UNSUPORTED = "001"
  val CONFIGURATION_WRONG_INPUT = "002"
}
  

trait DBServerErrorMsg{}
object DBServerErrorMsg{
  val CONFIGURATION_UNSUPORTED = "The DB configuration is not supported"
  val CONFIGURATION_WRONG_INPUT = "The input to construct configuration is wrong."
}